package com.oglvip.business.remote.service.api;

import com.oglvip.business.dto.ResponseData;
import com.oglvip.business.remote.service.Targets;
import com.oglvip.business.remote.service.entity.Order;
import com.oglvip.business.remote.service.entity.OrderDetail;
import com.oglvip.business.remote.service.entity.PageData;
import com.oglvip.business.remote.service.entity.StoreOrderView;
import com.oglvip.business.remote.support.annotation.RestClient;
import com.oglvip.business.remote.support.request.ContentTypes;

import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;

/**
 * @auther hanchao
 * @date 2017/1/7 15:43
 */
@RestClient(Targets.PLATFORM_API)
@Path("/api/order")
public interface OrderService {
    @POST
    @Path("/store/overview")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<StoreOrderView> overview(@FormParam("ticket")String ticket, @FormParam("storeId") Integer storeId);

    @POST
    @Path("/list/forstore")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<PageData<Order>> list(@FormParam("ticket")String ticket, @FormParam("storeId") Integer storeId,@FormParam("orderStatus")Integer orderStatus,
                                       @FormParam("orderNo")String orderNo,@FormParam("startTime")String startTime,@FormParam("endTime")String endTime,
                                       @FormParam("start")Integer start,@FormParam("size")Integer size);

    @POST
    @Path("/delete")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData delete(@FormParam("ticket")String ticket,@FormParam("orderNo")String orderNo,@FormParam("timestamp")Long timestamp,@FormParam("sig")String sig);

    @POST
    @Path("/detail")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData<OrderDetail> getDetail(@FormParam("ticket")String ticket,@FormParam("orderNo")String orderNo,@FormParam("timestamp")Long timestamp,@FormParam("sig")String sig);

    @POST
    @Path("/send")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData send(@FormParam("ticket")String ticket,@FormParam("orderNo")String orderNo,@FormParam("timestamp")Long timestamp,@FormParam("sig")String sig);

    @POST
    @Path("/receive")
    @Consumes(ContentTypes.APPLICATION_FORM_URLENCODED)
    ResponseData receive(@FormParam("ticket")String ticket,@FormParam("orderNo")String orderNo,@FormParam("timestamp")Long timestamp,@FormParam("sig")String sig);
}
